package com.party.core.dao.read.gift;

import com.party.common.paging.Page;
import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.gift.Gift;
import com.party.core.model.gift.GiftListOut;
import com.party.core.model.gift.GiftListOutput;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: Administrator.
 * @Description: 礼包
 * @Date:Created in 2017/11/15 0015 上午 10:30.
 */
@Repository
public interface GiftReadDao extends BaseReadDao<Gift> {
    /**
     * web端查询
     *
     * @param gift
     * @param params
     * @param page
     * @return
     */
    List<GiftListOutput> webListPage(@Param(value = "gift") GiftListOutput gift, @Param(value = "params") Map<String, Object> params, Page page);

    /**
     * 根据项目id和类型获取礼包
     *
     * @param targetId
     * @param type
     * @return
     */
    List<Gift> findByTargetId(@Param(value = "targetId") String targetId, @Param(value = "type") String type);

    /**
     * 获取所有礼包
     *
     * @param memberId 用户id
     * @param isOrder  是否领取
     * @param page
     * @return
     */
    List<GiftListOut> findAllByMemberId(@Param(value = "memberId") String memberId, @Param(value = "isOrder") Integer isOrder, Page page);

    /**
     * 获取过期的礼包
     *
     * @param memberId 用户id
     * @return
     */
    List<String> getOverdue(@Param(value = "memberId") String memberId);
}
